package jps_s10996_s7175.result;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;

import jps_s10996_s7175.utils.IPrintable;
import edu.pjwstk.jps.result.IBagResult;
import edu.pjwstk.jps.result.ISingleResult;

public class SequenceResult extends CollectionResult implements IBagResult,
		IPrintable {

	public SequenceResult() {
		this.col = new LinkedList<ISingleResult>();
	}

	public SequenceResult(ISingleResult... args) {
		this.col = new ArrayList<ISingleResult>();
		for (ISingleResult arg : args) {
			col.add(arg);
		}
	}

	@Override
	public Collection<ISingleResult> getElements() {
		return col;
	}

	public void add(ISingleResult res) {
		this.col.add(res);
	}

	@Override
	public String stringme() {
		String result = "";
		int i = 0;
		result += "sequence(";
		for (ISingleResult item : col) {
			if (i > 0) {
				result += ", ";
			} // separator
			result += ((SingleResult) item).stringme();
			++i;
		}
		result += ")";

		return result;

	}

}
